﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="FinLend001b.aspx.cs" Inherits="Admin_FinLend_FinLend001b" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phScript" runat="Server">
    <link href="../../Plugin/font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" />
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .subTable {
            border: none !important;
        }

            .subTable td {
                border: none !important;
                padding-right: 8px;
            }
    </style>
    <script type="text/javascript">
        $(function () {
            $("i[data-hid]").each(function () {
                $(this).click(function () {
                    var did = $(this).attr("data-hid");

                    $("[data-id='" + did + "']").each(function () {
                        $(this).toggle();
                    });
                });
            });

            $("#chk_sel_all").change(function () {
                var isChecked = $(this).is(":checked");

                $(".sel_class>input[type='checkbox']").each(function () {
                    $(this).attr("checked", isChecked);
                });

            });

            $("#btnBatch").click(function () {
                var selIds = "";
                $(".sel_class>input[type=checkbox]").each(function () {
                    if ($(this).is(":checked")) {
                        selIds += $(this).prev().val() + ",";
                    }
                });
                if (selIds.length == 0) {
                    alert("请选择您要批量修改的凭证!");
                    return false;
                }
                else {
                    OpenWindow("凭证批量修改", "B", "/Admin/FinSav/FinSav002a.aspx?type=B&ids=" + selIds, 700, 680);
                }
                return false;
            });

        });


        function AddLend() {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length > 0) {
                if (confirm("您确定要借阅所选的凭证？")) {
                    var ids = "";
                    checkList.each(function () {
                        ids += $(this).attr("id").replace("chk_sel", "") + ",";
                    });
                    $("#<%=HiddenFieldIds.ClientID%>").val(ids);
                    $("#<%=btnAdd.ClientID%>").click();
                    //window.location.href = "FinLend001c.aspx?ids=" + ids + "&lendId=<%=lendId%>&thirdUnitId=<%=thirdUnitId%>";
                    //alert(ids);
                }
            }
            else {
                alert("请选择您要借阅的凭证!");
            }
        }
    </script>
    <script type="text/javascript">
        function searchDiv() {
            $("#tbSearch").toggle("fast");
            if ($("#divButton").hasClass("open")) {
                $("#divButton").removeClass("open");
                $("#divButton").addClass("close")
            }
            else {
                $("#divButton").removeClass("close");
                $("#divButton").addClass("open")
            }

        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 100%; min-width: 700px">
        <div class="searchBox">
            <div class="c">
                <div class="sb1">搜索条件</div>
                <div class="sb2 close" onclick="searchDiv()" id="divButton"></div>
            </div>
            <table cellspacing="2" cellpadding="2" id="tbSearch" style="display: none">
                <tr>
                    <td>文档盒条形码:</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtBoxNo" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                    <td>外仓条形码:</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtSupplierBoxNo" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                </tr>
                <tr>
                    <td>文档描述:</td>
                    <td>
                        <yncWebDDL:DrpCodeTable ID="drpDocType" runat="server" Category="CTE006" ShowSelectedItem="true" Width="255px">
                        </yncWebDDL:DrpCodeTable>
                    </td>
                    <td>凭证号:</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtKey" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                </tr>
                <tr>
                    <td width="100px">文档日期:
                    </td>
                    <td>
                        <span style="color: #000;">
                            <input class="Wdate textBox" style="width:100px;" runat="server" readonly="readonly"
                                type="text" id="txtDocumentStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtDocumentEndDate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                       <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtDocumentEndDate"
                           clientidmode="Static" style="width:100px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtDocumentStartDate\');}',maxDate:'9998-12-31'})" />
                        </span>
                    </td>
                    <td width="100px">初次入库日期:
                    </td>
                    <td>
                        <span style="color: #000;">
                            <input class="Wdate textBox" style="width:100px;" runat="server" readonly="readonly"
                                type="text" id="txtStoreStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtStoreEndDate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                        <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtStoreEndDate"
                            clientidmode="Static" style="width:100px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStoreStartDate\');}',maxDate:'9998-12-31'})" />
                        </span>
                    </td>
                </tr>
                <tr>
                    <td>公司代码:</td>
                    <td>
                        <yncWebDDL:DrpCompanyName ID="drpCompany" runat="server" Width="255px">
                        </yncWebDDL:DrpCompanyName>
                    </td>
                    <td>职能部门:</td>
                    <td>
                        <yncWebDDL:DrpCodeTable ID="drpFunctionDept" runat="server" Category="CTE001" ShowSelectedItem="true" Width="255px">
                        </yncWebDDL:DrpCodeTable>
                    </td>
                </tr>

                <tr>
                    <td width="100px">录入时间:
                    </td>
                    <td>
                        <span style="color: #000;">
                            <input class="Wdate textBox" style="width:100px;" runat="server" readonly="readonly"
                                type="text" id="txtStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtEndate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                    <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtEndate"
                        clientidmode="Static" style="width:100px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStartDate\');}',maxDate:'9998-12-31'})" />
                        </span>

                    </td>
                    <td>存储地点:</td>
                    <td>
                        <yncWebDDL:DrpThirdUnit ID="drpThirdUnit" runat="server" ShowSelectedItem="true" Required="true" Width="255px">
                        </yncWebDDL:DrpThirdUnit>
                    </td>
                </tr>
                <tr>
                    <td>用户名(SAP):</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtUserName" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                    <td>凭证类型(SAP):</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtDocumentsType" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                </tr>
                <tr>
                    <td>业务类型(SAP):</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtReferenceTransact" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                    <td>凭证系统(SAP):</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtDocumentSystem" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                </tr>
                <tr>
                    <td>是否SAP凭证:</td>
                    <td>
                        <yncWeb:yncTextBox ID="YncTextBox1" runat="server" Width="245px"></yncWeb:yncTextBox>
                    </td>
                    <td>关联系统(SAP):</td>
                    <td>
                        <yncWeb:yncTextBox ID="txtLogicalSystem" runat="server" Width="245px"></yncWeb:yncTextBox>

                    </td>
                </tr>
                <tr>

                    <td colspan="4"><span style="margin-left: 8px">
                        <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" /></span></td>
                </tr>
            </table>
        </div>
        <table width="100%" cellspacing="2" cellpadding="2" class="menu" align="left" style="margin-top: 10px;">
            <td style="width: 3px;">&nbsp;
            </td>
            <td class="td">
                <a class="batch" onclick="AddLend()" href="#">加入借阅</a>
                <a class="view" href="FinLend001d.aspx?lendId=<%=lendId%>&thirdUnitId=<%=thirdUnitId%>">查看借阅(<%=Business.getFinLendReceiptCount(lendId.Value) %>)</a>
                <a class="back" href="FinLend001.aspx">返回</a>
            </td>
        </table>
        <yncWeb:PagnationGrid PageSize="100" ID="pageGrid" runat="server" OnOnPageIndexChange="PageChanged">
            <HeaderTemplate>
                <table width="2080px" cellspacing="0" cellpadding="0" class="pagnationtable" align="left" style="table-layout: fixed">
                    <thead>
                        <tr>
                            <th width="60px">
                                <asp:CheckBox ID="chk_sel_all" ClientIDMode="Static" runat="server" Text="序号" />
                            </th>
                            <th width="40px">SAP?</th>
                            <th width="90px">凭证盒条码
                            </th>
                            <th width="90px">外仓条形码
                            </th>
                            <th width="110px">文档描述
                            </th>
                            <th width="110px">文档日期
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Document Number in SAP">凭证索引号1(SAP)</a>
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Reference in SAP">凭证索引号2(SAP)</a>
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Reference Key in SAP">凭证索引号3(SAP)</a>
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Document Header in SAP">凭证索引号4(SAP)</a>
                            </th>
                            <th width="100px"><a class="thTitle" href="#" onclick="return false;" title="Company Code in SAP">公司代码(SAP)</a>
                            </th>
                            <th width="100px">公司名称
                            </th>
                            <th width="100px">职能部门
                            </th>
                            <th width="100px">实物存储状态
                            </th>
                            <th width="100px">实物存储地点
                            </th>
                            <th width="100px">电子存储状态
                            </th>
                            <th width="100px">初次入库时间
                            </th>
                            <th width="100px">已保管期限
                            </th>
                            <th width="100px">应保管期限
                            </th>
                            <th width="100px">销毁时间
                            </th>
                            <th width="100px">备注
                            </th>

                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td class="sel_class">
                        <i class="fa fa fa-info-circle" style="cursor: pointer;" data-hid="d<%# Container.ItemIndex +1 %>"></i><%# Container.ItemIndex +1 %>
                        <input type="hidden" id="h<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>" value="<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>" />
                        <input type="checkbox" id="chk_sel<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>" />
                        <asp:Label ID="lbReceiptID" runat="server" Visible="false" Text="<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>"></asp:Label>
                    </td>
                    <td>
                        <%# GetYesOrNo(Eval(FinReceiptMetadata.ColumnNames.IsSAP))%>
                    </td>
                    <td>
                        <%#Eval(VReceiptExtInfoMetadata.ColumnNames.BoxNo)%>
                    </td>
                    <td>
                        <%#Eval(VReceiptExtInfoMetadata.ColumnNames.SupplierBoxNo)%>
                    </td>
                    <td>
                        <%#Eval("VoucherDescriptionName")%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.VoucherDate)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentsNo)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.Reference)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.ReferenceKey)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentHeaderText)%>
                    </td>
                    <td>
                        <%# Eval(BFCompanyDicMetadata.ColumnNames.CompanyCode)%>
                    </td>
                    <td>
                        <%# Eval(BFCompanyDicMetadata.ColumnNames.CompanyName)%></td>
                    <td>
                        <%#Eval(FinReceiptMetadata.ColumnNames.FunctionDept+"Str")%>
                    </td>
                    <td><%# Eval(FinReceiptMetadata.ColumnNames.StorageStatus+"Str")%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.StorageLocation+"Str")%>
                    </td>

                    <td><%# Eval(FinReceiptMetadata.ColumnNames.EStorageStatus)%>
                    </td>
                    <td><%#Eval(FinReceiptMetadata.ColumnNames.FirstStorageDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td>
                        <%#getYear(Eval(FinReceiptMetadata.ColumnNames.StoreStartDate))%>
                    </td>
                    <td>
                        <%#Eval(FinReceiptMetadata.ColumnNames.NeedStoreYear)%>
                    </td>
                    <td>
                        <%#Eval(FinReceiptMetadata.ColumnNames.DestoryDate)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.Comments)%>
                    </td>

                </tr>
                <tr class="odd" style="display: none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>录入人</b></td>
                    <td colspan="4">
                        <%#Eval(FinReceiptMetadata.ColumnNames.CreatedBy)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Reversed With in SAP">冲销凭证号(SAP)</a></td>
                    <td colspan="5">
                        <%# Eval(FinReceiptMetadata.ColumnNames.RevesedBy)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Document Type in SAP">凭证类型(SAP)</a></td>
                    <td colspan="8">
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentsType)%></td>
                </tr>
                <tr class="odd" style="display: none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>录入时间</b></td>
                    <td colspan="4">
                        <%#Eval(FinReceiptMetadata.ColumnNames.CreatedDttm).FormatDate(ConstantValue.DateTimeFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="User Name in SAP">用户名(SAP)</a></td>
                    <td colspan="5">
                        <%#Eval(FinReceiptMetadata.ColumnNames.UserName)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Reference Trasact in SAP">业务类型(SAP)</a></td>
                    <td colspan="9">
                        <%# Eval(FinReceiptMetadata.ColumnNames.ReferenceTransact)%></td>
                </tr>
                <tr class="odd" style="display: none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>转移记录</b></td>
                    <td colspan="4">
                        <%#Eval(FinReceiptMetadata.ColumnNames.TransferRecord)%></td>

                    <td><a class="thTitle" href="#" onclick="return false;" title="Document Date in SAP">文档日期(SAP)</a></td>
                    <td colspan="5">
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="这条凭证信息来自于哪个SAP系统">凭证系统(SAP)</a></td>
                    <td colspan="9">
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentSystem)%></td>
                </tr>
                <tr class="odd" style="display: none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>转移日期</b></td>
                    <td colspan="4"><%#Eval(FinReceiptMetadata.ColumnNames.LastTransferDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Posting Date in SAP">凭证入帐日期(SAP)</a></td>
                    <td colspan="5">
                        <%# Eval(FinReceiptMetadata.ColumnNames.PostingDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Logical System in SAP">关联系统(SAP)</a></td>
                    <td colspan="9">
                        <%# Eval(FinReceiptMetadata.ColumnNames.LogicalSystem)%></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </yncWeb:PagnationGrid>
    </div>
    <asp:Button ID="btnAdd" runat="server" Text="tianjia" OnClick="btnAdd_Click" Style="display: none" />
    <asp:HiddenField ID="HiddenFieldIds" runat="server" />
    <script type="text/javascript">

        function showNews(msg) {
            alert(msg);
            window.location.href = "FinLend001b.aspx?lendId=<%=lendId%>&thirdUnitId=<%=thirdUnitId%>";
        }

    </script>
</asp:Content>

